package com.atwisdom.star.controller;

import com.atwisdom.star.core.bsl.functionClass.impl.BatchNumberBslServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Calendar;
import java.util.Map;

@RestController
@RequestMapping("/common")
public class CommonController {
    @Autowired
    private BatchNumberBslServiceImpl batchNumberBslService;

    /**
     *
     * @param param 序更名称以数据
     * @return 返回结果
     */
    @PostMapping(value = "/getCurrentVal")
    @ResponseBody
    public String getCurrentVal(@RequestBody Map<String,String> param) {
        return batchNumberBslService.getCurrentVal(param);
    }

    /**
     *
     * @param code 业务功能编码
     * @return 返回结果
     */
    @PostMapping(value = "/getCurrentValByCode")
    @ResponseBody
    public String getCurrentValByCode(String code) {
        return batchNumberBslService.getCurrentValByCode(code);
    }


    /**
     *
     * @param param 序更名称以数据
     * @return 返回结果
     */
    @PostMapping(value = "/getNextVal")
    @ResponseBody
    public String getNextVal(@RequestBody Map<String,String> param) {
        return batchNumberBslService.getNextVal(param);
    }

    /**
     *
     * @param code 业务功能编码
     * @return 返回结果
     */
    @PostMapping(value = "/getNextValByCode")
    @ResponseBody
    public String getNextValByCode(String code) {
        return batchNumberBslService.getNextValByCode(code);
    }

}
